'''
Created on May 29, 2010

@author: Behrooz Nobakht
'''
from amscms import settings


'''
Simply forces a language for the system based on 
settings.USE_FIXED_LANGUAGE and settings.LANGUAGE_CODE

@author: Behrooz Nobakht
'''
class FixedLocaleMiddleware:
    
    def process_request(self, request):
        if not settings.USE_FIXED_LANGUAGE:
            return None
        request.session['django_language'] = settings.LANGUAGE_CODE
        return None
